// 获取当天日期
function getDateTime(type) {
	// 获取当前日期
    let timestamp = Date.parse(new Date());
    let date = new Date(timestamp);
    if (type == 'tomorrow') { // 明天
        date.setDate(date.getDate() + 1);

    } else if (type == 'today') { // 今天
        date.setDate(date.getDate());
    }
    //获取年份  
    var Y = date.getFullYear();
    //获取月份  
    var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
    //获取当日日期 
    // var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
    var D =  date.getDate();
    var myDate = new Date();
    var week = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六")[myDate.getDay()];
    
    let todayDate = M + '月'+ D + '日' + ' '+ week 
    return todayDate
}
export default getDateTime